import axios from '@/utils/request';
const baseProjectOriginURL = process.env.VUE_APP_BASE_ORIGIN + '/iot_project';
const baseDeviceOriginURL = process.env.VUE_APP_BASE_ORIGIN + '/iot_device';
const baseCommonOriginURL = process.env.VUE_APP_BASE_ORIGIN + '/iot_common';
const baseMaintenanceOriginURL = process.env.VUE_APP_BASE_ORIGIN + '/iot_maintenance'; //维保中心

// 获取项目列表
const getProjectList = data => {
  return axios.get(baseProjectOriginURL + '/project/getProjectList', { params: data });
};

// 获取项目详情
const getProjectDetail = data => {
  return axios.get(baseProjectOriginURL + '/project/getProjectDetail', { params: data });
};
// 获取设备列表
const getDeviceList = data => {
  return axios.get(baseProjectOriginURL + '/project/getDeviceList', { params: data });
};

// 获取产线列表
const getProductLineList = data => {
  return axios.get(baseDeviceOriginURL + '/device/getProductLineList', { params: data });
};
// 获取维修记录
const getMaintenanceList = data => {
  return axios.get(baseProjectOriginURL + '/project/getMaintenanceList', { params: data });
};
// 获取报警记录
const getAlarmNoticeList = data => {
  return axios.get(baseProjectOriginURL + '/project/getAlarmNoticeList', { params: data });
};

// 获取文档列表
const getFolderList = data => {
  return axios.get(baseProjectOriginURL + '/project/getFolderList', { params: data });
};
// 获取文件列表
const getFileList = data => {
  return axios.get(baseProjectOriginURL + '/project/getFileList', { params: data });
};

// 获取所有客户类型
const getCustomerTypeList = data => {
  return axios.get(baseDeviceOriginURL + '/device/getCustomerTypeList', { params: data });
};

// 获取公司列表
const getCustomerList = data => {
  return axios.get(baseCommonOriginURL + '/message/getCustomerList', { params: data });
};

// 获取设备详情
const getDeviceDetail = data => {
  return axios.get(baseDeviceOriginURL + '/device/getDeviceDetail', { params: data });
};

// 获取报警通知详情
const getAlarmNoticeDetail = data => {
  return axios.get(baseMaintenanceOriginURL + '/maintenance/getAlarmNoticeDetail', { params: data });
};

export {
  getProjectList,
  getProjectDetail,
  getDeviceList,
  getProductLineList,
  getMaintenanceList,
  getAlarmNoticeList,
  getFolderList,
  getFileList,
  getCustomerTypeList,
  getCustomerList,
  getDeviceDetail,
  getAlarmNoticeDetail
};
